

public class ObjectToClone {
    private static final int MONTHS = 12;
    private int id;
    private String title;
    private float[] fractions;
    private static int count = 5;

    public ObjectToClone(String title) {
        id = 1000 + count++;
        this.title = title;
        fractions = new float[count];
        for (int i = 0; i < fractions.length; i++)
            fractions[i] = i / (float) count;
    }

    public ObjectToClone() {
        id = 1111;
        title = "unnamed";
        fractions = new float[MONTHS];
        for (int i = 0; i < fractions.length; i++)
            fractions[i] = 0.5f + i * MONTHS;
    }

    public ObjectToClone clone() {
        ObjectToClone clone = new ObjectToClone();
        clone.id = this.id;
        clone.title = this.title;
        clone.fractions = new float[this.fractions.length];
        for (int i = 0; i < clone.fractions.length; i++) {
            clone.fractions[i] = this.fractions[i];
        }
        return clone;
    }
}